package org.kamionowski.supreme.persistence.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;

/**
 * Created by IntelliJ IDEA.
 * User: Marcin Kamionowski
 * Date: 13.04.11
 * Time: 16:07
 */
@javax.persistence.Table(name = "search_host_ip", schema = "public", catalog = "")
@Entity
public class HostIP implements Serializable {
    private Integer id;

    @javax.persistence.Column(name = "id", nullable = false, insertable = true, updatable = true, length = 10, precision = 0)
    @Id
    @SequenceGenerator(name="hostIPSeq")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    private Boolean active;

    private String IP;

    @javax.persistence.Column(name = "ip", nullable = false, insertable = true, updatable = true, length = 255, precision = 0)
    @Basic
    public String getIP() {
        return IP;
    }

    public void setIP(String IP) {
        this.IP = IP;
    }

    private Host host;

    @ManyToOne
    public
    @javax.persistence.JoinColumn(name = "host_id", referencedColumnName = "id", nullable = false)
    Host getHost() {
        return host;
    }

    public void setHost(Host host) {
        this.host = host;
    }

    @Override
    public String toString() {
        return this.IP;
    }
}
